package com.runner.player.input;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.Vector2;
import com.runner.player.Ringer;

public class RingerInputComponent extends PlayerInputComponent {

	public RingerInputComponent(Ringer ringer) {
		super(ringer);
	}

	@Override
	public boolean touchDown(float x, float y) {
		if (x > Gdx.graphics.getWidth() * 0.50f) {
			// dont jump when user hits pause button in upper right
			if (y > Gdx.graphics.getHeight() * 0.2f) {
				player.jump();
			}
		} else {
			// if (y > Gdx.graphics.getHeight() * 0.5f) {
			player.roll();
			// } else {
			// player.dive();
			// }
		}
		return false;
	}

	@Override
	public boolean fling(float velocityX, float velocityY) {
		Vector2 dir = new Vector2(velocityX, velocityY);
		dir.nor();
		if (dir.x > Math.sqrt(2) / 2) { // swipe right

		}
		if (dir.y > Math.sqrt(2) / 2) { // swipe down
		}
		if (dir.x < -Math.sqrt(2) / 2) { // swipe left
		}
		if (dir.y < -Math.sqrt(2) / 2) { // swipe up
		}
		return false;
	}

	@Override
	public boolean tap(float x, float y) {
		player.touchUp();
		return false;
	}

}
